package com.tianji.learning.controller;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

@RequiredArgsConstructor
@RestController
@RequestMapping("admin/replies")
@Api("管理员相关回答接口")
public class InteractionReplyAdminController {

    private final IInteractionReplyService replyService;

    @GetMapping("page")
    @ApiOperation("分页查询评论或者回答列表")
    public PageDTO<ReplyVO> queryAdminPageVO(ReplyPageQuery replyPageQuery){
        return replyService.queryAdminPageVO(replyPageQuery);
    }

    @PutMapping("{id}/hidden/{hidden}")
    @ApiOperation("隐藏评论或者回答")
    public void hiddenReply(@PathVariable Long id, @PathVariable Boolean hidden){
        replyService.hiddenReply(id, hidden);
    }

}
